<?php

$dashboardItems = $this->getData('dashboardItems');

$webroot = \Instelling::GET('website.root');
$categorie = '';
$menu = '';
$tmp = '';

    while ($dbRij = $dashboardItems->fetch(\PDO::FETCH_ASSOC)){
        if($categorie != $dbRij['groep']){
            if(!empty($menu)){
                $menu .= '</ul></li>';
                $tmp .= $menu;

            }
            $categorie = $dbRij['groep'];
            $menu = <<<EOD
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown"  href="#" >
                            <span class="glyphicon {$dbRij['glyphicon']}"> </span>
                            &nbsp; {$dbRij['groep']}
                            &nbsp; <span class="caret"></span>

                        </a>
                        <ul class="dropdown-menu">    
EOD;
    }
         $menu .= <<<EOD
                <li>
                    <a href="{$webroot}{$dbRij['pad']}">
                           {$dbRij['naam']}
                    </a>
                </li>
EOD;

}
       if(!empty($menu)){
            $menu .= '</ul></li>';
            $tmp .= $menu;
            
       }
    
$balk = '<ul class="nav nav-pills"> '.$tmp.'</ul>';
\Weergave::SETWEERGAVE('dashboardbalk',$balk);


